import type { Menu } from '../../type/login'

import '../../assets/css/home.less'
import { useNavigate } from 'react-router-dom';
import '../../assets/css/home.less'
import '../../assets/icon/iconfont.css'
import '../../assets/icon/demo.css'
import { useSelector } from 'react-redux';
function Menus() {
    // const [menus, setMenus] = useState<Menu[]>([])
    const navigate = useNavigate();
    const navigateTo = (url: string) => {
        navigate(url);
    }
    const menus = useSelector((state: any) => state.menus).filter((item: Menu) => item.postion === 'left');
    return (
        menus.map((item:any) => (
            <div className='menulist' key={item.id} onClick={() => navigateTo(item.url)}>
                <i style={{fontSize:32,color:'#727e97'}} className={`iconfont ${item.ico}`}></i>

                <div>
                    {item.name.slice(0, 2)}
                </div>
            </div>
        ))
    )
}
export default Menus